package HP.p0904;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class Test {

    public static void main(String[] args) throws Exception {

        Map map = new HashMap();
        map.put("zs", "zhangsan");
        map.put("ls", "lisi");
        // System.out.println(map.get("zs"));
        // System.out.println(map.size());
        // map.remove("ls");
        // System.out.println(map.size());
        // System.out.println(map.containsKey("zs"));
        // System.out.println(map.containsValue("????"));
        // System.out.println(map.keySet());
        Set set = map.keySet();
        // for (Object obj : set) {
        // System.out.println(obj + "\t" + map.get(obj));
        // }
        Iterator it = set.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
        }
        System.out.println("-------------------------------------------------");
        Collection list = map.values();

        Iterator it2 = list.iterator();

        while (it2.hasNext()) {
            System.out.println(it2.next());
        }

        // for (Object obj2 : list) {// ????
        // System.out.println(obj2);
        // }

    }

}
